package com.useeinfo.oa.modules.repair.enums;

/**
 * @Auther: xudong.sun
 * @Date: 2018/12/12 09:48
 * @Description:
 */
public enum RepairOrderStatusEnum {

    WAIT_TAKING("WAIT_TAKING", "待接单"),WAIT_PRESENCE("WAIT_PRESENCE","待到场"),WAIT_CONFIRM_FAULT("WAIT_CONFIRM_FAULT","待确认故障"),
    UNFINISHED("UNFINISHED","待完成"),REJECTED("REJECTED","退回重修"),IN_AUDITING("IN_AUDITING","审批中"),CANCELED("CANCELED","已取消"),
    COMPLETED("COMPLETED","已完成");

    private String code;

    private String name;

    public String getCode() {
        return this.code;
    }

    public String getName() {
        return this.name;
    }

    RepairOrderStatusEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static RepairOrderStatusEnum getEnum(String code){
        if(code.equals("WAIT_TAKING")){
            return WAIT_TAKING;
        }else if(code.equals("WAIT_PRESENCE")){
            return WAIT_PRESENCE;
        }else if(code.equals("WAIT_CONFIRM_FAULT")){
            return WAIT_CONFIRM_FAULT;
        }else if(code.equals("UNFINISHED")){
            return UNFINISHED;
        }else if(code.equals("REJECTED")){
            return REJECTED;
        }else if(code.equals("IN_AUDITING")){
            return IN_AUDITING;
        }else if(code.equals("CANCELED")){
            return CANCELED;
        }else if(code.equals("COMPLETED")){
            return COMPLETED;
        }else{
            return null;
        }
    }
}
